(function($) {

Galleria.addTheme({
    name: 'customer',
    author: 'HOWARD',
    version: '1.0',
    css: 'galleria.customer.css',
    defaults: {
		carousel:false,
		height:260,
        image_crop: 'height',
		image_position:'left',
        show_counter: false,
		show_imagenav: false,
		show_info: false,
		transition: 'fade',
		transition_speed: 700,
		extend: function() {
			this.bind(Galleria.IMAGE, function(e) {
				// bind a click event to the active image
				$(e.imageTarget).css('cursor','pointer').click(this.proxy(function() {
					// open the image in a lightbox
					this.openLightbox();
				}));
			});
		}
    },
    init: function(options) {
        this.$('thumbnails').children(function() {
            $(this).not('.active').children().stop().fadeTo(400, 0.4);
        }).not('.active').children().css('opacity',.4);
        
        
        this.bind(Galleria.LOADSTART, function(e) {
            if (!e.cached) {
                this.$('loader').show().fadeTo(200, 0.4);
            }
            this.$('info').hide();
        });

        this.bind(Galleria.LOADFINISH, function(e) {
            this.$('loader').fadeOut(200);
        });
        this.bind(Galleria.LOADSTART, function(e) {
            $(e.thumbTarget).css('opacity',1).parent().addClass('active')
                .siblings('.active').removeClass('active').children().css('opacity',0.4);
        })
    }
});

})(jQuery);